Automate the Boring Stuff with Python

By Al Sweigart. Over 500,000 copies sold. Free to read under a Creative Commons license.

Buy from Publisher (Free ebook!)

Amazon | Barnes and Nobles | Powell's | Bookshop.org | Goodreads | Kobo | Thriftbooks

“The best part of programming is the triumph of seeing the machine do something useful. Automate the Boring Stuff with Python frames all of programming as these small triumphs; it makes the boring fun.”

-Hilary Mason, Data Scientist and Founder of Fast Forward Labs

“I'm having a lot of fun breaking things and then putting them back together, and just remembering the joy of turning a set of instructions into something useful and fun, like I did when I was a kid.”

-Wil Wheaton, WilWheaton.net

“If you are new to Python, get this book. ... If you lie in the category of experienced Pythonistas and haven’t read this book, you should also take out some time and read it.”

-The Startup

“Valuable to have on your shelf...an extremely useful book.”

Kids, Code, and Computer Science Magazine

"One of the best books for learning Python."

Giles McMullen-Klein, FlickThrough Reviews

If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do this work for you?

In this fully revised third edition of Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand—no prior programming experience required. Early chapters will teach you the fundamentals of Python through clear explanations and engaging examples. You’ll write your first Python program; work with strings, lists, dictionaries, and other data structures; then use regular expressions to find and manipulate text patterns.

Once you’ve mastered the basics, you’ll tackle projects that teach you to use Python to automate tasks like:

  • Searching the web, downloading content, and filling out forms
  • Finding, extracting, and manipulating text and data in files and spreadsheets
  • Copying, moving, renaming, or compressing saved files on your computer
  • Splitting, merging, and extracting text from PDFs and Word documents
  • Interacting with applications through custom mouse and keyboard macros
  • Managing your inbox, unsubscribing from lists, and sending email or text notifications

Table of Contents

(The 1st edition and 2nd edition are still available.)

Automate the Boring Stuff with Python - Workbook

Thumbnail cover of Automate the Boring Stuff with Python Workbook

Buy from Publisher (Free ebook!) Read Online for Free

Amazon | Barnes and Noble | Bookshop.org | Powell's | Kobo | Thriftbooks | Goodreads

A companion to Automate the Boring Stuff with Python, Third Edition. This workbook transforms Al Sweigart’s best-selling guide from a reading experience into a coding experience. Following Automate the Boring Stuff with Python chapter by chapter, this workbook will help you turn concepts into muscle memory through carefully designed exercises, projects, and real Python scripts.

Every concept from Automate is reinforced through carefully sequenced questions, exercises, and projects that help you think like a programmer and prove to yourself that you really get it.

At the end of each chapter, you’ll tackle miniprojects that bring everything together. Whether you’re renaming files, scraping websites, converting text to speech, modifying spreadsheets, or sending emails, you’ll build scripts that do real work. Fun projects like image generators and word games are in the mix too, not just boring stuff.

Review eBook Offer: If you have made at least $50 in purchases in an Amazon account and can write reviews, you may request a review ebook copy in exchange for writing an honest review of the book. Fill out this form to be contacted about receiving a review copy of Automate the Boring Stuff -- Workbook

Recent News

November 13, 2025: Anki, Quizlet, Brainscape... I dislike all these overcomplicated flashcard apps. I just want the software equivalent of index cards, so I created TSOFA - The Simple, Offline, Flashcard App. It's exists entirely in a single HTML file you can view in the browser. You can edit the flashcards directly in the file, using just text or HTML tags. Otherwise, it's just a simple, free flashcard app: No server, no ads, no registration, no premium features to pay for, no dependencies, no build process, no cloud sync.

November 10, 2025: How to Get the "Automate the Boring Stuff with Python" Udemy Course for Free or at a Discount

More news and content are available on my Python blog.

Online Video Course

This video course follows much (though not all) of the content of the 1st edition of the book. Use this link to apply a 70% discount code. You can preview the first 15 course videos for free on YouTube.

Request a Review Copy

If you have made at least $50 in purchases in an Amazon account and can write reviews, you may request a review ebook copy in exchange for writing an honest review of the book. Fill out this form to be contacted about receiving a review copy of Automate the Boring Stuff with Python, 3rd Edition

Additional Content

Download the files used in this book.

Donate / Write a Review

There are several ways you can support the author:

Other Books by the Author

Al Sweigart has been writing programming books (mostly Python, mostly for beginners) since 2009. All of them are free to read online under a Creative Commons license at https://inventwithpython.com.

About the Author

Al Sweigart is a software developer, author of several programming books, and a Fellow of the Python Software Foundation. He is the author of several programming books for beginners, including Invent Your Own Computer Games with Python, The Big Book of Small Python Projects, and Beyond the Basic Stuff with Python (all from No Starch Press). He is an international speaker at several PyCon conferences. His website is https://inventwithpython.com.

Reports that Al is an AI have been grossly exaggerated.